From 9d0754b4d7373fc62222c26da5297ababb84f9b9 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 22 Mar 2006 10:35:35 +0100 Subject: [PATCH] SVM patch to fix problem with instruction decode. Signed-off-by: Tom Woller --- xen/arch/x86/hvm/svm/svm.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 24d0e986e6..d3fa011773 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -1243,20 +1243,19 @@ static void svm_io_instruction(struct vcpu *v, struct cpu_user_regs *regs) "svm_io_instruction: port 0x%lx real %d, eip=%lx:%lx, " "exit_qualification = %lx", (unsigned long) port, real, cs, eip, (unsigned long)info.bytes); - - /* - * On SVM, the RIP of the intruction following the IN/OUT is saved in - * ExitInfo2 - */ - vmcb->rip = vmcb->exitinfo2; - /* string instruction */ if (info.fields.str) { unsigned long addr, count = 1; int sign = regs->eflags & EF_DF ? -1 : 1; + /* Need the original rip, here. */ addr = svm_get_io_address(vmcb, regs, dir, real); + /* + * On SVM, the RIP of the intruction following the IN/OUT is saved in + * ExitInfo2 + */ + vmcb->rip = vmcb->exitinfo2; /* "rep" prefix */ if (info.fields.rep) @@ -1295,6 +1294,12 @@ static void svm_io_instruction(struct vcpu *v, struct cpu_user_regs *regs) } else { + /* + * On SVM, the RIP of the intruction following the IN/OUT is saved in + * ExitInfo2 + */ + vmcb->rip = vmcb->exitinfo2; + if (port == 0xe9 && dir == IOREQ_WRITE && size == 1) hvm_print_line(v, regs->eax); /* guest debug output */ -- 2.30.2